package com.linkage.educloud.ah.bean;

import android.os.Parcel;
import android.os.Parcelable;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 周振 on 2017/3/2.
 */

public class MessItem implements Parcelable {
    private String id;
    private String title;
    private String content;
    private String desc;
    private int icon;
    private int threadType;
    private int chatType;
    private int type;

    public static List<MessItem> fromJSONObject(JSONObject json){
        List<MessItem> items = new ArrayList<>();
        // TODO: 2018/11/5 解析
        return items;
    }
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getThreadType() {
        return threadType;
    }

    public void setThreadType(int threadType) {
        this.threadType = threadType;
    }

    public int getChatType() {
        return chatType;
    }

    public void setChatType(int chatType) {
        this.chatType = chatType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.title);
        dest.writeString(this.content);
        dest.writeString(this.desc);
        dest.writeInt(this.icon);
        dest.writeInt(this.threadType);
        dest.writeInt(this.chatType);
        dest.writeInt(this.type);
    }

    public MessItem() {
    }

    protected MessItem(Parcel in) {
        this.id = in.readString();
        this.title = in.readString();
        this.content = in.readString();
        this.desc = in.readString();
        this.icon = in.readInt();
        this.threadType = in.readInt();
        this.chatType = in.readInt();
        this.type = in.readInt();
    }

    public static final Parcelable.Creator<MessItem> CREATOR = new Parcelable.Creator<MessItem>() {
        @Override
        public MessItem createFromParcel(Parcel source) {
            return new MessItem(source);
        }

        @Override
        public MessItem[] newArray(int size) {
            return new MessItem[size];
        }
    };
}
